<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>医生列表</title>
	
	<script type="text/javascript"
		src="../static/assets/jquery/jquery-1.10.2.min.js"></script>
	<script type="text/javascript" src="../static/js/common.js"></script>
	
	<script type="text/javascript">
	
		 function del(url){
			if(confirm('您确定要删除该医生的信息？')) {
				
				$.get(url, function(data) {
					alert(data.msg);
					location.reload();
				});
				//location.href = url;
			}
		 }
	</script>
</head>
<body>

	<form name="searchForm" action="/admin/doctor/search" method="post">
	
		<div><span>
		
		姓名<input type="text" name="name" id="name" value="${searchName}" ></input>&nbsp;&nbsp;
		<select name="roleId">
			<option value="-1">请选择职位</option> 
			<#list roles as role> 
				<#if role.id == searchRoleId>
					<option value="${role.id}" selected="selected">${role.name}</option>
				<#else>
					<option value="${role.id}">${role.name}</option> 
				</#if> 
			</#list>
		</select>
		
		<select name="sex">
			<option value="-1" >性别</option>
			<option value="1" <#if searchSex == 1 >selected="selected"</#if> >男</option>
			<option value="0" <#if searchSex == 0 >selected="selected"</#if> >女</option>
		</select>
				
				
		<select name="departmentId">
			<option value="-1">请选择科室</option> 
			<#list departments as department>
				<#if department.id == searchDepartmentId>
					<option value="${department.id}" selected="selected">${department.name}</option>
				<#else>
					<option value="${department.id}">${department.name}</option>
				</#if> 
			</#list>
		</select>
				<input type="submit" name="subButton"
					id="subButton" value="查询" />		
		</span>
		
		</div>
		
	</form>

	<style>
		table {
			width: 100%;
		}
		
		th {
			height:25px;
			line-height:25px;
		}
		
		td{
			line-height:25px;
		}
	</style>
	
	
	<div>医生信息</div>
	<table border="1" cellspacing="0" cellpadding="0" >
		<thead>
			<th>账号</th>
			<th>姓名</th>
			<th>头像</th>
			<th>性别</th>
			<th>年龄</th>
			<th>类别</th>
			<th>简介</th>
			<th>科室</th>
			<th>操作</th>
		</thead>
		<tbody>
			<#list doctorList.list as doctor>
			<tr>
				<td>${doctor.account}</td>
				<td>${doctor.name}</td> 
				<td><img src="${(doctor.image)!}" onload="resizeImage(this, 80, 120);" /></td>
				<td><#if doctor.sex ==1>男<#else>女</#if></td> 
				<td>${doctor.age}</td>
				<td>${doctor.getRole().name}</td>
				<td>${doctor.desc}</td>
				<td>${doctor.getDepartment().name}</td>
				<td>&nbsp;&nbsp;&nbsp;<a
					href="/admin/doctor/edit/${doctor.id}">编辑</a>
					&nbsp;&nbsp;&nbsp;<a href="javascript:void(0)"
					onclick="del('/admin/doctor/delete/${doctor.id}')">删除</a>
				</td>
			</tr>
			</#list>
		</tbody>
	</table>
	

	<div>
		<span style="margin-left: 10px"> 
		总共记录 ：${doctorList.totalRow} 条；共${doctorList.totalPage} 页；第 ${doctorList.pageNumber} 页； 
		<a href="/admin/doctor/?p=1<#if searchPage == 1>&s=1</#if>" >[首页]</a>
		<a href="/admin/doctor/?p=<#if doctorList.pageNumber lte 1>1<#else>${doctorList.pageNumber - 1}</#if><#if searchPage == 1>&s=1</#if>" >[上一页]</a> 
		<a href="/admin/doctor/?p=<#if doctorList.pageNumber gte doctorList.totalPage>${doctorList.totalPage}<#else>${doctorList.pageNumber + 1}</#if><#if searchPage == 1>&s=1</#if>" >[下一页]</a> 
		<a href="/admin/doctor/?p=${doctorList.totalPage}<#if searchPage == 1>&s=1</#if>" >[末页]</a>
		每页显示${doctorList.pageSize}条数据 
		</span>
	</div>

</body>
</html>